package carTest.create;

import com.alibaba.fastjson.JSONArray;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClients;

/**
 * @description:
 * @author: 张德长 dechang.zhang@ucarinc.com
 * @date: 10:48:02 2018/12/13
 * @version:2.0
 */
public class CreateCarTest {
    public static HttpClient client = HttpClients.createDefault();

    public static void main(String[] args) {
        /*JSON userInfo = User.login(client, "账号", "密码");
        if (userInfo == null) {
            return;
        }*/
        /*** CarTest  requestType:1GET 2POST ***/
        Doc carTeestDoc = new Doc("172", "接口名称", "请求链接", "2", "接口说明");
        String request = "[{\"id\":\"1\",\"parentId\":\"0\",\"level\":\"1\",\"identifier\":\"请求变量1\",\"name\":\"\",\"dataType\":\"String\",\"isMust\":\"是\",\"type\":1}]";
        JSONArray requestJson = JSONArray.parseArray(request);
        String response = "[{\"id\":\"1\",\"parentId\":\"0\",\"level\":\"1\",\"identifier\":\"status\",\"name\":\"状态\",\"dataType\":\"Integer\",\"type\":2}]";
        JSONArray responseJson = JSONArray.parseArray(response);
        //设置请求参数
        carTeestDoc.requestParam = requestJson;
        //设置响应参数
        carTeestDoc.responseParam = responseJson;

        // Operation.add(carTeestDoc,client);
    }


}
